package com.pi2e.view.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
import butterknife.Bind;
import butterknife.ButterKnife;

import com.pi2e.R;
import com.pi2e.common.KdxfSpeechHelper;
import com.pi2e.tools.SystemUtil;
import com.pi2e.view.base.BaseActivity;
import com.pi2e.view.common.HeaderView;

public class MainActivity extends BaseActivity implements OnClickListener {

	@Bind(R.id.btn_vip)
	public Button btn_vip;
	@Bind(R.id.iv_user)
	public ImageView ivg_user;
	@Bind(R.id.iv_home)
	public ImageView ivg_home;
	@Bind(R.id.iv_setting)
	public ImageView ivg_setting;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		// 方法1 Android获得屏幕的宽和高    
        WindowManager windowManager = getWindowManager();    
        Display display = windowManager.getDefaultDisplay();    
        int screenWidth = screenWidth = display.getWidth();    
        int screenHeight = screenHeight = display.getHeight();   
        Toast.makeText(this, "screenWidth:"+screenWidth+"-----screenHeight:"+screenHeight, Toast.LENGTH_LONG).show();
	}
	

	@Override
	public void onClick(View v) {
		int vid = v.getId();
		Intent it = null ;
		switch (vid) {
		case R.id.btn_vip:
			it = new Intent( MainActivity.this,LoginActivity.class) ;
			it.putExtra("MainActivityFlag", "VIP") ;
			break;
		case R.id.iv_user:
			 it = new Intent(this, LoginActivity.class) ;
				it.putExtra("MainActivityFlag", "Welcom") ;
			break;
		case R.id.iv_home:
			 it = new Intent(this, LoginActivity.class) ;
			it.putExtra("MainActivityFlag", "RoomNum") ;
			
			break;
		case R.id.iv_setting:
			 it = new Intent(this, LoginActivity.class) ;
				it.putExtra("MainActivityFlag", "NETSET") ;
			break;
		}
		if (null != it) {
			startActivity(it);
		}
		
	}
	
	@Override
	public void initView() {
		// TODO Auto-generated method stub
		
		ivg_setting.setOnClickListener(this);
		ivg_user.setOnClickListener(this);
		ivg_setting.setOnClickListener(this);
		btn_vip.setOnClickListener(this);
		ivg_home.setOnClickListener(this);
		

	}
	@Override
	public HeaderView initHeaderView() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public void setContentView() {
		setContentView(R.layout.activity_main);
		ButterKnife.bind(MainActivity.this);
	}


	@Override
	public void initFootView() {
		// TODO Auto-generated method stub
		
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		
	}
	@Override
	protected void onPause() {
		super.onPause();
	}

}
